#include <REGX51.H>
#include "hd11.h"
unsigned char mydata[9];
void delay_ms(unsigned int z)
{
   unsigned int i,j;
   for(i=z;i>0;i--)
      for(j=114;j>0;j--);
}
void SG(int a,int b)
{
	unsigned char Tab[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x40};
  unsigned char Count[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
	P2=Count[a];
	P0=~Tab[b];
	delay_ms(2);
}

void main()
{

	while(1)
	{	
		DHT11_receive(&mydata);
		SG(0,mydata[0]);
		SG(1,mydata[1]);
		SG(2,mydata[2]);
		SG(3,mydata[3]);
		SG(4,mydata[4]);
		SG(5,mydata[5]);
		SG(6,mydata[6]);
		SG(7,mydata[7]);
	}
}